<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" import="java.util.List"
	import="java.util.ArrayList"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
     <!DOCTYPE html>
     <html>
      <head>
          <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
          <meta name="renderer" content="webkit|ie-comp|ie-stand">
          <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		  <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
		  <meta http-equiv="Cache-Control" content="no-siteapp" />
	          
          <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
          <script type="text/javascript" src="<%=request.getContextPath() %>/static/goods/js/html5shiv.js"></script>
		  <script type="text/javascript" src="<%=request.getContextPath() %>/static/goods/js/respond.min.js"></script>
		
		  <link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/static/goods/css/H-ui.min.css" />
		  <link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/static/goods/css/H-ui.admin.css" />
		  <link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/static/Hui-iconfont/1.0.8/iconfont.css" />
<%-- 		  <link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/static/goods/css/skin.css" id="skin" /> --%>
		  <link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/static/goods/css/style.css" />
		  <title>商品查询</title>
		  <script type="text/javascript" src="<%=request.getContextPath() %>/static/goods/js/DD_belatedPNG_0.0.8a-min.js" ></script>
		  <script>DD_belatedPNG.fix('*');</script>
			
		  <link rel="stylesheet" href="<%=request.getContextPath() %>/static/goods/css/zTreeStyle.css" type="text/css">
		  <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
		          <script type="text/javascript">
					function sel(){
						var goods = new Object();
						goods.name = $("#goods_name").val();
						jQuery.ajax({
							data : JSON.stringify(goods),
							dataTyep : "JSON",
							contentType: "application/json;charset=UTF-8",
							success: function(result) {
								var html = "";
								for(var i = 0; i < result.length; i++) {
									html += "<tr class='text-c va-m'>"+
											"<td>" + "<input name='' type='checkbox' value=''>" + "</td>" +
											"<td>" + result[i]["id"] + "</td>" +
											"<td>" + result[i]["name"] + "</td>" +
											"<td>" + result[i]["name"] + "</td>" +
											"<td>" + result[i]["stockNum"] + "</td>" +
											"<td>" + result[i]["sellOut"] + "</td>" +
											"<td>" + result[i]["price"] + "</td>" +
											"<td class='td-status'><span class='label label-success radius'>" + "已发布 " + "</span>" + "</td>" +
											"<td class='td-manage'>" + "<a style='text-decoration:none' onClick='product_stop(this,'10001')' href='javascript:;' title='下架'>" + "<i class='Hui-iconfont'>" + "&#xe6de;" +"</i>" + "</a>" + "<a style='text-decoration:none' class='ml-5' onClick='product_edit('产品编辑','product-add.html','10001')' href='javascript:;' title='编辑'>" + "<i class='Hui-iconfont'>" + "&#xe6df;"+"</i>" + "</a>" + " <a style='text-decoration:none' class='ml-5' onClick='product_del(this,'10001')' href='javascript:;' title='删除'>" + "<i class='Hui-iconfont'>" + "&#xe6e2;" + "</i>" + "</a>" + "</td>" +
											"</tr>"
								}
								$("tbody tr").remove();
								$("tbody").append(html);
			                      },
			                      error: function(result) {},
			                      type: "POST",
			                      url: "/foodie/get"
						});
						}
		          </script>
	  </head>  
      
      <body class="pos-r">
	      <!-- <div class="pos-a" style="width:200px;left:0;top:0; bottom:0; height:100%; border-right:1px solid #e5e5e5; background-color:#f5f5f5; overflow:auto;">
			<ul id="treeDemo" class="ztree"></ul>
		  </div>
		<div style="margin-left:200px;">
			<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 产品管理 <span class="c-gray en">&gt;</span> 产品列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav> -->
			<div class="page-container">
				<div class="text-c"> 日期范围：
					<input type="text" onfocus="WdatePicker({ maxDate:'#F{$dp.$D(\'logmax\')||\'%y-%M-%d\'}' })" id="logmin" class="input-text Wdate" style="width:120px;">
					-
					<input type="text" onfocus="WdatePicker({ minDate:'#F{$dp.$D(\'logmin\')}',maxDate:'%y-%M-%d' })" id="logmax" class="input-text Wdate" style="width:120px;">
					<input type="text" name="goods_name" id="goods_name" placeholder=" 产品名称" style="width:250px" class="input-text">
					<button name="" id=""  onclick="sel()" class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 搜产品</button>
				</div>
				<div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l"><a href="javascript:;" onclick="datadel()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a> <a class="btn btn-primary radius" onclick="product_add('添加产品','product-add.html')" href="http://localhost:8080/foodie/add"><i class="Hui-iconfont">&#xe600;</i> 添加产品</a></span> <span class="r">共有数据：<strong>54</strong> 条</span> </div>
				<div class="mt-20">
					<table class="table table-border table-bordered table-bg table-hover table-sort">
						<thead>
							<tr class="text-c">
								<th width="40"><input name="" type="checkbox" value=""></th>
								<th width="150">ID</th>
								<th width="60">缩略图</th>
								<th width="80">产品名称</th>
								<th width="30">库存数量</th>
								<th width="30">售出数量</th>
								<th width="80">单价</th>
								<th width="60">发布状态</th>
								<th width="100">操作</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach items="${goodsList }" var="goods">
								<tr class="text-c va-m">
									<td><input name="" type="checkbox" value=""></td>
									<td>${goods.id}</td>
									<td><a href="javascript:;"><img width="60" class="product-thumb" src="${goods.picture}"></a></td>
									<td class="" style="text-decoration:none;text-align: center"><a style="text-decoration:none;text-align: center" href="javascript:;">${goods.name} </a></td>
									<td class="" style="text-decoration:none;text-align: center">${goods.stockNum}</td>
									<td class="">${goods.sellOut}</td>
									<td><span class="price"></span>${goods.stockNum}元</td>
									<td class="td-status"><span class="label label-success radius">已发布</span></td>
									<td class="td-manage"><a style="text-decoration:none" onClick="product_stop(this,'10001')" href="javascript:;" title="下架"><i class="Hui-iconfont">&#xe6de;</i></a> <a style="text-decoration:none" class="ml-5" onClick="product_edit('产品编辑','product-add.html','10001')" href="javascript:;" title="编辑"><i class="Hui-iconfont">&#xe6df;</i></a> <a style="text-decoration:none" class="ml-5" onClick="product_del(this,'10001')" href="javascript:;" title="删除"><i class="Hui-iconfont">&#xe6e2;</i></a></td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
				</div>
			</div>
		</div>
      
      
      
          <%--       零食名字:<input type="text" name="goods_name" id="goods_name"  /><br />
				<button type="button" onclick="sel()">查询</button>
		       	<table id="sel" border="1" style="text-align:center">
			       	<thead>
			       		<tr>
			       			<th>姓名</th>
			       		</tr>
			       	</thead>
			       	<tbody>
			       		<c:forEach items="${goodsList}" var="goods">
							<tr>
								
								<td>${goods.name}</td>
							</tr>
						</c:forEach>
			       	</tbody>
		       	</table> --%>
		       	
		       	
		    <!--_footer 作为公共模版分离出去-->
			<script type="text/javascript" src="<%=request.getContextPath() %>/static/goods/js/jquery.min.js"></script> 
			<script type="text/javascript" src="<%=request.getContextPath() %>/static/goods/js/layer.js"></script>
			<script type="text/javascript" src="<%=request.getContextPath() %>/static/goods/js/H-ui.min.js"></script> 
			<script type="text/javascript" src="<%=request.getContextPath() %>/static/goods/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->
			
			<!--请在下方写此页面业务相关的脚本-->
			<script type="text/javascript" src="<%=request.getContextPath() %>/static/goods/js/jquery.ztree.all-3.5.min.js"></script>
			<script type="text/javascript" src="<%=request.getContextPath() %>/static/goods/js/WdatePicker.js"></script> 
			<script type="text/javascript" src="<%=request.getContextPath() %>/static/goods/js/jquery.dataTables.min.js"></script> 
			<script type="text/javascript" src="<%=request.getContextPath() %>/static/goods/js/laypage.js"></script> 
       </body>
	</html>